
/*
 * Copyright (C) 2008-2009 Archie L. Cobbs. All rights reserved.
 *
 * $Id: SidekarField.java 288 2010-01-11 19:45:47Z archie.cobbs $
 */

package org.dellroad.sidekar.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Tags a getter method in a Sidekar entity class as being the accessor
 * to a field in that entity.
 *
 * <p>
 * This annotation should annotate the getter method; it implicitly associates the corresponding setter method to
 * the field as well.
 *
 * @see org.dellroad.sidekar.FieldType Supported field types
 */
@Documented
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface SidekarField {

    /**
     * Specifies the name of the Sidekar entity field (which must have simple type)
     * that the annotated method is the getter for. This annotation should annotate
     * the "getter" method in the field's containing entity type. This annotation
     * also implicitly associates the corresponding "setter" method (if any).
     *
     * <p>
     * If "" (the default), the field name is taken from the method name using the
     * normal Java bean property naming rules.
     */
    String value() default "";
}

